import requests
from lxml import etree


url = 'https://store.steampowered.com/search/results/?query&start=0&count=50&dynamic_data=&sort_by=_ASC&supportedlang=schinese&snr=1_7_7_230_7&infinite=1'
response = requests.get(url)
print(response.json()['results_html'])
tree = etree.HTML(response.json()['results_html'])
blocks = tree.xpath('//a')
print(len(blocks))
for block in blocks:
    titles = block.xpath('.//span[@class="title"]/text()')[0]
    final_price = block.xpath('.//div[@class="discount_final_price"]/text()')
    if final_price:
        final_price = final_price[0]
    else:
        final_price = 'free'

    print(titles,final_price)
